<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<link rel="stylesheet" type="text/css" href="../bootstrap-3.3.7-dist/css/bootstrap.css"/>
		<style type="text/css">
			.red {
				background-color: red;
				color: white;
			}
		</style>
	</head>
	<body>
		<div id="app">
			<span :class="{'red': isActive}">普通的span标签</span>
			<button type="button" @click="isActive = !isActive">切换样式</button>
			<div class="list-group">
			  <a href="javascript:void(0);" v-for="(item, index) of menus" @click="curMenusIndex = index" class="list-group-item" :class="{'active': curMenusIndex===index}">{{item | numberFomat}}</a>
			</div>
		</div>
		<script src="../js/vue.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			let app = new Vue({
				el: "#app",
				data: {
					isActive: false,
					curMenusIndex: 0, 
					menus: [
						"Cras justo odio",
						"Dapibus ac facilisis in",
						"Morbi leo risus",
						"Porta ac consectetur ac",
						"Vestibulum at eros",
					]
				},
				methods: {
					
				},
				computed: {
					
				},
				filters: {
					//过滤器，只是做数据的修饰，与methods相似
					numberFomat(value) {
						return "￥" + value;
					}
				}
			})
		</script>
	</body>
</html>
